/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ParametrosCompresion.java
 *
 * Created on 15-dic-2010, 7:12:37
 */

package proyectotsm;

import javax.swing.JLabel;

/**
 *
 * @author srgank
 */
public class ParametrosCompresion extends javax.swing.JFrame {

    /** Creates new form ParametrosCompresion */
    public ParametrosCompresion() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        anchoteselasLabel = new javax.swing.JLabel();
        anchoteselas = new javax.swing.JLabel();
        anchoteselasSlider = new javax.swing.JSlider();
        altoteselasLabel = new javax.swing.JLabel();
        altoteselas = new javax.swing.JLabel();
        altoteselasSlider = new javax.swing.JSlider();
        parametroCompresionLabel = new javax.swing.JLabel();
        parametroCompresion = new javax.swing.JLabel();
        ParametroCompresionSlider = new javax.swing.JSlider();
        buttonOK = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        recur = new javax.swing.JLabel();
        recurSlider = new javax.swing.JSlider();
        rangoImagenes = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        rangoImagenesSlider = new javax.swing.JSlider();

        anchoteselasLabel.setText("Ancho Teselas");

        anchoteselas.setText("jLabel1");
        anchoteselas.setText(String.valueOf(anchoteselasSlider.getValue()));

        anchoteselasSlider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                anchoteselasSliderStateChanged(evt);
            }
        });

        altoteselasLabel.setText("Alto Teselas");

        altoteselas.setText("jLabel1");
        altoteselas.setText(String.valueOf(altoteselasSlider.getValue()));

        altoteselasSlider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                altoteselasSliderStateChanged(evt);
            }
        });

        parametroCompresionLabel.setText("Parametro Compresion");

        parametroCompresion.setText("jLabel2");
        parametroCompresion.setText(String.valueOf(ParametroCompresionSlider.getValue()));

        ParametroCompresionSlider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                ParametroCompresionSliderStateChanged(evt);
            }
        });

        buttonOK.setText("OK");
        buttonOK.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                buttonOKMousePressed(evt);
            }
        });

        jLabel1.setText("Radio de busqueda");

        recur.setText("jLabel2");
        recur.setText(String.valueOf(recurSlider.getValue()));

        recurSlider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                recurSliderStateChanged(evt);
            }
        });

        rangoImagenes.setText("rango");
        rangoImagenes.setName("NULL"); // NOI18N
        rangoImagenes.setText(String.valueOf(rangoImagenesSlider.getValue()));

        jLabel3.setText("Rango entre imagenes");

        rangoImagenesSlider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                rangoImagenesSliderStateChanged(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGap(29, 29, 29)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 41, Short.MAX_VALUE)
                        .addComponent(rangoImagenes))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 51, Short.MAX_VALUE)
                        .addComponent(recur))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                        .addComponent(altoteselasLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 85, Short.MAX_VALUE)
                        .addComponent(altoteselas))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                        .addComponent(anchoteselasLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 74, Short.MAX_VALUE)
                        .addComponent(anchoteselas))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(buttonOK)
                            .addComponent(parametroCompresionLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 125, Short.MAX_VALUE))
                        .addGap(18, 18, 18)
                        .addComponent(parametroCompresion)))
                .addGap(39, 39, 39)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(ParametroCompresionSlider, 0, 0, Short.MAX_VALUE)
                        .addComponent(anchoteselasSlider, 0, 0, Short.MAX_VALUE)
                        .addComponent(altoteselasSlider, javax.swing.GroupLayout.DEFAULT_SIZE, 165, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(rangoImagenesSlider, javax.swing.GroupLayout.Alignment.LEADING, 0, 0, Short.MAX_VALUE)
                        .addComponent(recurSlider, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 165, Short.MAX_VALUE)))
                .addGap(35, 35, 35))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(33, 33, 33)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(anchoteselasLabel)
                        .addComponent(anchoteselas))
                    .addComponent(anchoteselasSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(altoteselasLabel)
                            .addComponent(altoteselas)))
                    .addComponent(altoteselasSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(20, 20, 20)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(parametroCompresionLabel)
                        .addComponent(parametroCompresion))
                    .addComponent(ParametroCompresionSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel1)
                        .addComponent(recur))
                    .addComponent(recurSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(rangoImagenes)
                        .addComponent(jLabel3))
                    .addComponent(rangoImagenesSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 59, Short.MAX_VALUE)
                .addComponent(buttonOK)
                .addGap(31, 31, 31))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void anchoteselasSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_anchoteselasSliderStateChanged
        anchoteselas.setText(String.valueOf(anchoteselasSlider.getValue()));
    }//GEN-LAST:event_anchoteselasSliderStateChanged

    private void altoteselasSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_altoteselasSliderStateChanged
        altoteselas.setText(String.valueOf(altoteselasSlider.getValue()));
    }//GEN-LAST:event_altoteselasSliderStateChanged

    private void buttonOKMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_buttonOKMousePressed
        setVisible(false);
    }//GEN-LAST:event_buttonOKMousePressed

    private void ParametroCompresionSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_ParametroCompresionSliderStateChanged
        parametroCompresion.setText(String.valueOf(ParametroCompresionSlider.getValue()));
    }

    public int getAltoteselas() {
        return Integer.parseInt(altoteselas.getText());
    }

    public void setAltoteselas(JLabel altoteselas) {
        this.altoteselas = altoteselas;
    }

    public int getAnchoteselas() {
        return Integer.parseInt(anchoteselas.getText());
    }

    public void setAnchoteselas(JLabel anchoteselas) {
        this.anchoteselas = anchoteselas;
    }

    public int getParametroCompresion() {
        return Integer.parseInt(parametroCompresion.getText());
    }

    public int getRangoImagenes() {
        return Integer.parseInt(rangoImagenes.getText());
    }

    public void setRangoImagenes(JLabel rangoImagenes) {
        this.rangoImagenes = rangoImagenes;
    }

    public void setParametroCompresion(JLabel parametroCompresion) {
        this.parametroCompresion = parametroCompresion;
    }//GEN-LAST:event_ParametroCompresionSliderStateChanged

    private void recurSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_recurSliderStateChanged
        recur.setText(String.valueOf(recurSlider.getValue()));
    }//GEN-LAST:event_recurSliderStateChanged

    private void rangoImagenesSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_rangoImagenesSliderStateChanged
      rangoImagenes.setText(String.valueOf(rangoImagenesSlider.getValue()));
    }//GEN-LAST:event_rangoImagenesSliderStateChanged

    public int getRecur() {
        return Integer.parseInt(recur.getText());
    }

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new ParametrosCompresion().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JSlider ParametroCompresionSlider;
    private javax.swing.JLabel altoteselas;
    private javax.swing.JLabel altoteselasLabel;
    private javax.swing.JSlider altoteselasSlider;
    private javax.swing.JLabel anchoteselas;
    private javax.swing.JLabel anchoteselasLabel;
    private javax.swing.JSlider anchoteselasSlider;
    private javax.swing.JButton buttonOK;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel parametroCompresion;
    private javax.swing.JLabel parametroCompresionLabel;
    private javax.swing.JLabel rangoImagenes;
    private javax.swing.JSlider rangoImagenesSlider;
    private javax.swing.JLabel recur;
    private javax.swing.JSlider recurSlider;
    // End of variables declaration//GEN-END:variables

}
